package com.huawei.hianalytics.h;

import com.huawei.hianalytics.g.b;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public final class e {
    private static e a = null;
    private Map<String, d> b = new ConcurrentHashMap();

    private e() {
    }

    public static e a() {
        if (a == null) {
            b();
        }
        return a;
    }

    private static synchronized void b() {
        synchronized (e.class) {
            if (a == null) {
                a = new e();
            }
        }
    }

    public c a(byte[] bArr, Map<String, String> map, String str) {
        d dVar = (d) this.b.get(str);
        if (dVar != null) {
            return dVar.a(bArr, map);
        }
        b.b("ReportManager", "report instance is null");
        return new c(-100, "");
    }

    public synchronized void a(String str, String[] strArr) {
        b.b("HiAnalytics/event", "ReportManager:init instance with url");
        d dVar = new d(str);
        dVar.a(strArr);
        this.b.put(str, dVar);
    }
}
